package org.common.strategy2.Impl;

/**
 * ClassName: WxPayStrategy
 * Package: org.common.strategy.Impl
 * Description:
 *
 * @Author: @weixueshi
 * @Create: 2024/7/19 - 21:39
 * @Version: v1.0
 */

import org.common.strategy2.AbstractStrategyFactory;
import org.common.strategy2.Factory2;
import org.springframework.stereotype.Component;

/**
 * 支付宝支付策略
 */
@Component
public class AliPayStrategy2 extends AbstractStrategyFactory {

    @Override
    public void pay(String payType) {
        System.out.println("支付宝支付");
    }

    @Override
    public String invokeCommon() {
        return "子父类通用";
    }

    @Override
    public String payMethod(String payType) {
        System.out.println("支付宝独有");
        return "支付宝独有";
    }

    /**
     * 注册支付宝支付策略方法
     * @throws Exception
     */
    @Override
    public void afterPropertiesSet() throws Exception {
        Factory2.register("aliPay",this);
    }
}
